# Maintainer: Robin Candau <antiz@archlinux.org>
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>

pkgname=python-sentry_sdk
_pkgname=sentry-sdk
pkgver=1.37.1
pkgrel=1
pkgdesc="The official Python SDK for Sentry.io"
arch=('any')
url="https://sentry.io/for/python"
license=('MIT')
depends=('python-urllib3' 'python-certifi')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
optdepends=('python-aiohttp: adds support for the AIOHTTP-Server Web Framework'
            'python-bottle: adds support for the Bottle Web Framework'
            'python-celery: adds support for the Celery Task Queue System'
            'python-django: adds support for the Django Web Framework'
            'python-falcon: adds support for the Falcon Web Framework'
            'python-fastapi: adds support for the FastAPI framework'
            'python-flask: adds support for the Flask Web Framework'
            'python-grpcio: gRPC integration'
            'python-httpx: HTTPX integration'
            'python-loguru: Loguru Integration'
            'python-multipart: Optional dependency of Starlette to parse form data'
            'python-pymongo: PyMongo integration'
            'python-quart: adds support for the Quart Web Framework'
            'python-redis: adds support for the RQ Job Queue System'
            'python-sqlalchemy: captures queries from SQLAlchemy as breadcrumbs'
            'python-starlette: adds support for the Starlette Framework'
            'python-tornado: adds support for the Tornado Web Framework'
            'python-pure-eval: for richer stacktraces & additional variables'
            'python-executing: for richer stacktraces & better function names')
source=("https://github.com/getsentry/sentry-python/releases/download/${pkgver}/${_pkgname}-${pkgver}.tar.gz")
sha256sums=('7cd324dd2877fdc861f75cba4242bce23a58272a6fea581fcb218bb718bd9cc5')

build() {
	cd "${_pkgname}-${pkgver}"
	python -m build --wheel --no-isolation
}

package() {
	cd "${_pkgname}-${pkgver}"
	python -m installer --destdir="${pkgdir}" dist/*.whl

	install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
